/*
 * mongoDB  config
 */

var config = require('../config');
var mongoose = require('mongoose');

var options = {
	server: {
                auto_reconnect: true,
                poolSize: 4,
                socketOptions: {
                    keepAlive: 1
                }
            }
}
mongoose.connect(config.mongodbUrl,options);
var db = mongoose.connection;
db.on('error',console.error);
db.once('open',function(){
	console.log('success!');
});
exports = module.exports = db;